<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<jsp:useBean id="pizzaDB" class="beans.PizzaDB" scope="page">
	<jsp:setProperty name="pizzaDB" property="database" 
		value="${applicationScope.pizzaDAO}"/>
</jsp:useBean>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    	               "http://www.w3.org/TR/html4/loose.dtd">

<html>
  <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    	<title>Derpizza</title>
  </head>
	<body>
		<jsp:include page="header.jsp" />
		<h1>Nos Pizza!</h1>
		<form method="POST" action="/Derpizza/Acheter">
		<table>
			<tr>
				<th>Pizza</th>
				<th>Prix</th>
				<th>Ajouter</th>
			</tr>	
			<c:forEach var="pizza" begin="0" items="${pizzaDB.pizzas}">
				<tr>
					<td>${pizza.nom}</td>
					<td>${pizza.prix}</td>
					<td>
						<input type="hidden" name="idProduit" value="${pizza.id}" />
						<input type="text" name="quantite" size="2"/>
					</td>
				</tr>
			</c:forEach>
		</table>
		<input type="submit" value="Miam" />
		</form>
		<br /><br />
		<h1>Votre Panier</h1>
		<jsp:include page="/printPanier.jsp" />
		<jsp:include page="/footer.jsp" />
	</body>
</html> 
